home *** CD-ROM | disk | FTP | other *** search
- head 1.8;
- branch ;
- access ;
- symbols sprited:1.8.1;
- locks ; strict;
- comment @ * @;
-
-
- 1.8
- date 90.02.19.14.44.15; author douglis; state Exp;
- branches 1.8.1.1;
- next 1.7;
-
- 1.7
- date 89.06.23.11.27.42; author rab; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 89.01.26.09.24.02; author brent; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 89.01.20.15.26.11; author brent; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 88.10.30.14.01.03; author brent; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 88.10.28.11.25.48; author brent; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 88.10.19.14.25.55; author brent; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 88.08.16.12.24.00; author brent; state Exp;
- branches ;
- next ;
-
- 1.8.1.1
- date 91.11.17.18.28.34; author kupfer; state Exp;
- branches ;
- next ;
-
-
- desc
- @Definitions for pdev library routines.
- @
-
-
- 1.8
- log
- @added Pdev_GetStreamID declaration.
- @
- text
- @/*
- * pdev.h --
- *
- * Definitions for pseudo-device library routines. The man page
- * for pdev (or Pdev_Open) has necessary documentation.
- *
- * Copyright 1988 Regents of the University of California
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- *
- * $Header: /sprite/src/lib/include/RCS/pdev.h,v 1.7 89/06/23 11:27:42 rab Exp Locker: douglis $ SPRITE (Berkeley)
- */
-
- #ifndef _PDEVLIB
- #define _PDEVLIB
-
- #include <fs.h>
- #include <dev/pdev.h>
-
- /*
- * Boolean that can be toggled by applications command line arguments.
- * This causes print statements that trace pdev/pfs operations.
- */
- extern int pdev_Trace;
-
- /*
- * The library keeps a set of callback procedures, one for each pdev request
- * that arrives on a request stream. Fields can be set to NULL to get
- * a default handler for the operation. See the man page for the
- * calling sequence of each call-back procedure.
- */
-
- typedef struct {
- int (*open)(); /* PDEV_OPEN */
- int (*read)(); /* PDEV_READ */
- int (*write)(); /* PDEV_WRITE and PDEV_WRITE_ASYNC */
- int (*ioctl)(); /* PDEV_IOCTL */
- int (*close)(); /* PDEV_CLOSE */
- /*
- * The following are only used for pseudo-device connnections
- * into a pseudo-file-system. For regular pseudo-devices the
- * kernel completely handles attributes.
- */
- int (*getAttr)(); /* PDEV_GET_ATTR */
- int (*setAttr)(); /* PDEV_SET_ATTR */
- } Pdev_CallBacks;
-
- /*
- * A Pdev_Stream is is passed to the PDEV_OPEN call-back handler.
- * This provides a handle on the particular stream to the pseudo-device.
- * The handle for the stream is passed to each call-back procedure.
- */
- typedef struct Pdev_Stream {
- unsigned int magic; /* Either PDEV_MAGIC or PDEV_STREAM_MAGIC */
- int streamID; /* Sprite stream identifier, either of
- * control or server stream depending
- * on context of the token. */
- ClientData clientData; /* For use by the client of the Pdev package */
- } Pdev_Stream;
-
- typedef char *Pdev_Token; /* Opaque token for the pseudo-device */
-
- #define PDEV_MAGIC 0xabcd1234
- #define PDEV_STREAM_MAGIC 0xa1b2c3d4
-
- #ifndef max
- #define max(a, b) \
- ( ((a) > (b)) ? (a) : (b) )
- #endif
-
- extern char pdev_ErrorMsg[];
-
- extern Pdev_Token Pdev_Open();
- extern void Pdev_Close();
- extern int (*Pdev_SetHandler())();
- extern int Pdev_EnumStreams();
- extern int Pdev_GetStreamID();
-
- extern Pdev_Stream *PdevSetup();
-
- #endif /* _PDEVLIB */
- @
-
-
- 1.8.1.1
- log
- @Initial branch for Sprite server.
- @
- text
- @d16 1
- a16 1
- * $Header: /sprite/src/lib/include/RCS/pdev.h,v 1.8 90/02/19 14:44:15 douglis Exp $ SPRITE (Berkeley)
- @
-
-
- 1.7
- log
- @*** empty log message ***
- @
- text
- @d16 1
- a16 1
- * $Header: /sprite/src/lib/include/RCS/pdev.h,v 1.6 89/01/26 09:24:02 brent Exp Locker: rab $ SPRITE (Berkeley)
- d82 1
- @
-
-
- 1.6
- log
- @Final adjustments on library interface
- @
- text
- @d16 1
- a16 1
- * $Header: /sprite/src/lib/include/RCS/pdev.h,v 1.4 88/10/30 14:01:03 brent Exp Locker: brent $ SPRITE (Berkeley)
- d85 1
- a85 1
- #endif _PDEVLIB
- @
-
-
- 1.5
- log
- @Split out the pseudo-file-system stuff into its own file
- @
- text
- @d7 1
- a7 1
- * Copyright 1985, 1988 Regents of the University of California
- d54 1
- a54 4
- * A Pdev_Token is used in two ways. A (pointer to a) Pdev_Token is returned
- * from the Pdev_Open call. This provides a top-level handle for the whole
- * pseudo-device. Then each time a process opens the pseudo-device another
- * (pointer to a) Pdev_Token is passed to the PDEV_OPEN call-back handler.
- d58 1
- a58 1
- typedef struct Pdev_Token {
- d64 1
- a64 1
- } Pdev_Token;
- d66 2
- d71 5
- d78 7
- a84 4
- extern ClientData Pdev_Open();
- extern ReturnStatus Pdev_Ready();
- extern void Pdev_Close();
- extern void Pdev_SetHandler();
- @
-
-
- 1.4
- log
- @changed pfsTraceNaming to pdevTrace
- @
- text
- @d4 2
- a5 7
- * Definitions for pseudo-device library routines. See the C file
- * /sprite/src/lib/c/etc/pdev.c for the implementation of
- * Pdev_Open and Pdev_Close. They take care of all the details
- * of the server-kernel pseudo-device protocol. Their user only
- * needs to supply service procedures that are called when client
- * processes operate on the pseudo-device. Fs_Dispatch must be
- * used in order for the service procedures to be called back.
- d16 1
- a16 1
- * $Header: /sprite/src/lib/include.new/RCS/pdev.h,v 1.3 88/10/28 11:25:48 brent Exp Locker: brent $ SPRITE (Berkeley)
- d29 1
- a29 1
- extern int pdevTrace;
- d33 3
- a35 5
- * that arrives on a request stream. They are type IntProc, and are kept
- * as an array (IntProc *). Pdev_Open and Pfs_Open take an optional argument
- * which defines an array of call back procedures. The argument can be null,
- * or individual elements of the array can be null, in order to get default
- * handlers for all, or some, of the pdev requests.
- a36 1
- typedef int (*IntProc)();
- d38 15
- d54 6
- a59 122
- * The calling sequences for the callbacks are as follows:
- * PDEV_OPEN
- * PdevOpen(token, flags, pid, hostID, uid, privatePtr, selectBitsPtr)
- * ClientData token; (Needed for Pdev_Ready call)
- * int flags; (flags to open system call)
- * int pid; (process ID of opening "client" process)
- * int hostID; (Sprite hostID of the client)
- * int uid; (User ID of client process)
- * ClientData *privatePtr; (Return - reference to private data)
- * (that gets passed to other callbacks)
- * int *selectBitsPtr; (Return - initial select state of pdev)
- * (FS_READABLE | FS_WRITABLE | FS_EXCEPTION)
- *
- * PDEV_CLOSE
- * PdevClose(private)
- * ClientData private; (Set by open service procedure)
- *
- * PDEV_READ
- * PdevRead(private, offset, familyID, numBytesPtr, bufferPtr, freeItPtr,
- * selectBitsPtr)
- * ClientData private; (Set by open service procedure)
- * int offset; (Bytes offset at which to read)
- * int familyID; (Family ID of calling process)
- * int *numBytesPtr; (In/Out - how much to read/was read)
- * Address *bufferPtr; (Ref. to buffer to fill in with data)
- * ( this can be changed by ReadProc)
- * int *freeItPtr; (In/Out boolean indicating if *bufferPtr
- * ( needs to be free'd. If TRUE on entry
- * ( ReadProc should free *bufferPtr before
- * ( changing the buffer pointer)
- * int *selectBitsPtr; (Return - select state of pdev)
- *
- * PDEV_WRITE
- * PdevWrite(private, offset, familyID, numBytesPtr, buffer, selectBitsPtr)
- * ClientData private; (Set by open service procedure)
- * int offset; (Bytes offset at which to read)
- * int familyID; (Family ID of calling process)
- * int *numBytesPtr; (In/Out - how much to write/was written)
- * Address buffer; (Buffer containing data)
- * int *selectBitsPtr; (Return - select state of pdev)
- *
- * PDEV_IOCTL
- * PdevIoctl(private, command, familyID, inSize, inBuffer, outSizePtr,
- * outBuffer, selectBitsPtr)
- * ClientData private; (Set by open service procedure)
- * int command; (IOControl command)
- * int familyID; (Family ID of calling process)
- * int inSize; (Size of inBuffer)
- * Address inBuffer; (Buffer containing input data)
- * int *outSizePtr; (Result - size of outBuffer)
- * Address outBuffer; (Buffer containing result data)
- * int *selectBitsPtr; (Return - select state of pdev)
- *
- * PDEV_GET_ATTR
- * PdevGetAttr(private, attrPtr, selectBitsPtr)
- * ClientData private; (Set by open service procedure (?))
- * Fs_Attributes *attrPtr; (Returned attributes)
- * int *selectBitsPtr; (Return - select state of pdev)
- *
- * PDEV_SET_ATTR
- * PdevSetAttr(private, flags, uid, gid, attrPtr, selectBitsPtr)
- * ClientData private; (Set by open service procedure (?))
- * int flags; (FS_SET_*, what attrs to set)
- * int uid; (User ID of calling process)
- * int gid; (Group ID of calling process)
- * Fs_Attributes *attrPtr; (Returned attributes)
- * int *selectBitsPtr; (Return - select state of pdev)
- *
- * Pseudo-filesystem requests that appear on the naming request-response stream.
- * For all requests except PFS_OPEN the library handles returning a reply.
- *
- * PFS_OPEN
- * PfsOpen(private, name, openArgsPtr, pfsToken, redirectInfoPtr)
- * ClientData private; (Set by the call to Pfs_Open)
- * char *name; (Name of file in pseudo-filesystem)
- * FsOpenArgs *openArgsPtr;(Specifies mode, uid, gid, and prefixID)
- * ClientData pfsToken; (Token needed to open pseudo-device
- * connection for the file. From Pfs_Open)
- * FsRedirectInfo *redirectInfoPtr; (Specifies new pathname)
- *
- * If this procedure returns SUCCESS then the library assumes that
- * an IOC_PFS_OPEN or IOC_PFS_PASS_STREAM has been done to reply to
- * the request. If an error code is returned then the library does
- * an IOC_PDEV_REPLY to reply to the request.
- *
- * PFS_GET_ATTR
- * PfsGetAttr(private, name, openArgsPtr, attrPtr, redirectInfoPtr)
- * ClientData private; (Set by the call to Pfs_Open)
- * char *name; (Name of file to get attributes of)
- * FsOpenArgs *openArgsPtr;(Specifies uid, gid, and prefixID)
- * Fs_Attributes *attrPtr; (Result - attributes of the file)
- * FsRedirectInfo *redirectInfoPtr; (Specifies new pathname)
- *
- * PFS_SET_ATTR
- * PfsSetAttr(private, name, openArgsPtr, flags, attrPtr, redirectInfoPtr)
- * ClientData private; (Set by the call to Pfs_Open)
- * char *name; (Name of file to get attributes of)
- * FsOpenArgs *openArgsPtr;(Specifies uid, gid, and prefixID)
- * int flags; (FS_SET_*, indicate what attrs to set)
- * Fs_Attributes *attrPtr; (New attributes for the file)
- * FsRedirectInfo *redirectInfoPtr; (Specifies new pathname)
- *
- * PFS_MAKE_DIR
- * PfsMakeDir(private, name, openArgsPtr, redirectInfoPtr)
- * ClientData private; (Set by the call to Pfs_Open)
- * char *name; (Name of directory to create)
- * FsOpenArgs *openArgsPtr;(Specifies mode, uid, gid, and prefixID)
- * FsRedirectInfo *redirectInfoPtr; (Specifies new pathname)
- *
- * PFS_REMOVE
- * PfsRemove(private, name, lookupArgsPtr, redirectInfoPtr)
- * ClientData private; (Set by the call to Pfs_Open)
- * char *name; (Name of file to remove)
- * FsLookupArgs *lookupArgsPtr;(Specifies uid, gid, and prefixID)
- * FsRedirectInfo *redirectInfoPtr; (Specifies new pathname)
- *
- * PFS_REMOVE_DIR
- * PfsRemoveDir(private, name, lookupArgsPtr, redirectInfoPtr)
- * ClientData private; (Set by the call to Pfs_Open)
- * char *name; (Name of directory to remove)
- * FsLookupArgs *lookupArgsPtr;(Specifies uid, gid, and prefixID)
- * FsRedirectInfo *redirectInfoPtr; (Specifies new pathname)
- d61 7
- d69 3
- a77 2
- extern ClientData Pfs_Open();
- extern ReturnStatus Pfs_OpenConnection();
- @
-
-
- 1.3
- log
- @Added comments for the callback routines
- @
- text
- @d21 1
- a21 1
- * $Header: /sprite/src/lib/include.new/RCS/pdev.h,v 1.2 88/10/19 14:25:55 brent Exp Locker: brent $ SPRITE (Berkeley)
- d32 1
- d34 1
- a34 1
- extern int pfsTraceNaming;
- @
-
-
- 1.2
- log
- @Added externs and IntProc typedef
- @
- text
- @d21 1
- a21 1
- * $Header: /sprite/src/lib/include.new/RCS/pdev.h,v 1.1 88/08/16 12:24:00 brent Exp Locker: brent $ SPRITE (Berkeley)
- d35 8
- d45 125
- d177 1
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d21 1
- a21 1
- * $Header: sprite.h,v 1.3 88/07/15 16:42:41 ouster Exp $ SPRITE (Berkeley)
- d30 7
- d42 2
- @
-